import { CHANGE_USERNAME } from './mutation-type'

export default{
  /**
   * define 'mutation', handle change for sync way
   * @param {*} state state in root store
   * @param {*} payload params of carrier
   */
  [CHANGE_USERNAME] (state, payload) {
    state.user.username = payload
  }
  // you also can use 'destruction' in ES6,which prefer to choose
  // [CHANGE_USERNAME] (state, {
  //   username
  // }) {
  //   state.username = username
  // }
}
